package com.xiaomengkuan.test.controller;

import com.xiaomengkuan.test.entity.pojo.Tag;
import com.xiaomengkuan.test.service.TagService;
import com.xiaomengkuan.test.util.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Faraj Mujey
 * -- Creation Time: 2021-01-11 2:07 下午, File Encoding: utf8 --
 */
@RestController
@RequestMapping("test/tag")
@CrossOrigin
public class TagController {
    @Resource
    TagService tagService;
    @GetMapping("getAllTagByType/{type}")
    public R getAllTagByType(@PathVariable("type")int type){
        List<Tag> tags = tagService.findAllByType(type);
        return R.OK().put("list", tags);
    }
}
